<%@include file="/WEB-INF/templates/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="windows-1252"%>

<h2>${pageTitle}</h2>
<c:if test="${not empty foutMelding}">
    <!-- Mochten er foutmeldingen zijn, dan worden ze hier getoond -->
    <p>${foutMelding}</p>
</c:if>
<c:choose>
    <c:when test="${empty chapter.chapterid}">
        <!-- Als er geen id is meegegeven, ga je een cursus toevoegen -->
        <form id="nieuweCursus" action="new" method="post">
        </c:when>
        <c:otherwise>
            <!-- Anders ga je een gebruiker wijzigen -->
            <form id="wijzigenCursus" action="edit" method="post">
            </c:otherwise>
        </c:choose>
        <p>
            <c:if test="${not empty chapter.chapterid}">
                <!-- Het id wordt meegestuurd, om te bepalen welke cursus je gaat wijzigen -->
                <input type="hidden" name="chapterid" id="chapterid" value="${chapter.chapterid}"></input>
            </c:if>
            <input type="hidden" name="courseid" id="courseid" value="${course.courseid}"></input>
        <table border="0">
            <tr><td><label for="chaptername">Chapter Title</label></td></tr>
            <tr><td><input type="textfield" id="chaptername" name="chaptername" value="${chapter.chapterName}"></input></td></tr>

            <tr><td><label for="chapterdescription">Chapter Description</label></td></tr>
            <tr><td><textarea rows="4" cols="50" id="chapterdescription" class="mceEditor" name="chapterdescription">${chapter.chapterdescription}</textarea></td></tr>

            <tr><td><label for="chaptercontent">Chapter Content</label></td></tr>
            <tr><td><textarea rows="8" cols="50" id="chaptercontent" class="mceEditor"  name="chaptercontent">${chapter.chapterContent}</textarea></td></tr>
            
            <tr><td><label for="chapterpicture">Chapter Picture</label></td></tr>
            <tr><td><input type="textfield" id="chapterpicture" name="chapterpicture" value="${chapter.chapterpicture}"></input></td></tr> 
        </table>
        </p>
        <p>
            <input class="submit" type="submit" value="${buttonTitle}">
        </p>
    </form>